home *** CD-ROM | disk | FTP | other *** search
/ ftp.mactech.com 2010 / ftp.mactech.com.tar / ftp.mactech.com / machack / Hacks97 / WarriorsProgress.sit / Warrior’s Progress / source code / Source / Libraries / Views / Standard Views / ListView.h < prev    next >
Text File  |  1997-06-28  |  982b  |  48 lines

  1. // ListView.h
  2.  
  3. #ifndef ListView_h
  4. #define ListView_h
  5.  
  6. #ifndef View_h
  7. #include "View.h"
  8. #endif
  9.  
  10. class ViewCell;
  11.  
  12. class ListView: public View
  13.   {
  14.     private:
  15.         uint32 cellHeight;
  16.         uint32 cellCount;
  17.         
  18.         uint32 PixelToCell( uint32 p ) const     { return p / cellHeight; }
  19.         
  20.         Rectangle CellArea( const ViewMap&, uint32 cell ) const;
  21.         Rectangle CellArea( const ViewMap&, Range<uint32> cells ) const;
  22.         Rectangle UnusedArea( const ViewMap& ) const;
  23.         
  24.     protected:
  25.         virtual const ViewCell& operator[]( uint32 ) const = 0;
  26.         virtual ViewCell& operator[]( uint32 ) = 0;
  27.         
  28.         void SetCellHeight( uint32 );
  29.         
  30.         void AddedCells( Range<uint32> );
  31.         void RemovedCells( Range<uint32 > );
  32.         
  33.     public:
  34.         ListView();
  35.         
  36.         virtual void Draw( const ViewMap& ) const;
  37.         
  38.         void Update( uint32 ) const;
  39.         void Redraw( uint32 ) const;
  40.         void Invalidate( uint32 ) const;
  41.         
  42.         void Update( Range<uint32> ) const;
  43.         void Redraw( Range<uint32> ) const;
  44.         void Invalidate( Range<uint32> ) const;
  45.   };
  46.  
  47. #endif
  48.